/*
Copyright [2020] [https://www.xiaonuo.vip]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Snowy采用APACHE LICENSE 2.0开源协议，您在使用过程中，需要注意以下几点：

1.请不要删除和修改根目录下的LICENSE文件。
2.请不要删除和修改Snowy源码头部的版权声明。
3.请保留源码和相关描述文件的项目出处，作者声明等。
4.分发源码时候，请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名，模块名称，项目代码等时，请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点，可申请商业授权，获取Snowy商业授权许可，请在官网购买授权，地址为 https://www.xiaonuo.vip
 */
package vip.xiaonuo.modular.blogcomment.param;

import lombok.Data;
import lombok.experimental.Accessors;
import vip.xiaonuo.core.pojo.base.param.BaseParam;

import javax.validation.constraints.Max;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * 评论参数类
 *
 * @author 刘文理
 * @date 2021-08-18 15:06:33
 */
@Data
@Accessors(chain = true)
public class BlogCommentParam extends BaseParam {

    /**
     * 主键id
     */
    @NotNull(message = "主键id不能为空，请检查commentId参数", groups = {edit.class, delete.class, detail.class,toggle.class})
    private Long commentId;

    /**
     * 关联的blog主键
     */
    @NotNull(message = "关联的blog主键不能为空，请检查blogId参数", groups = {add.class, edit.class})
    private Long blogId;

    /**
     * 评论者名称
     */
    @NotBlank(message = "评论者名称不能为空，请检查commentator参数", groups = {add.class, edit.class})
    private String commentator;

    /**
     * 评论人的邮箱
     */
    @NotBlank(message = "评论人的邮箱不能为空，请检查email参数", groups = {edit.class})
    private String email;

    /**
     * 网址
     */
    @NotBlank(message = "网址不能为空，请检查websiteUrl参数", groups = {edit.class})
    private String websiteUrl;

    /**
     * 评论内容
     */
    @NotBlank(message = "评论内容不能为空，请检查commentBody参数", groups = {add.class, edit.class})
//    @Max(value = 500, message = "评论内容过长，不能超过200个字符", groups = {add.class, edit.class})
    @Size(min = 0, max = 200, message = "评论内容过长，不能超过200个字符", groups = {add.class, edit.class})
    private String commentBody;

    /**
     * 评论时的ip地址
     */
    @NotBlank(message = "评论时的ip地址不能为空，请检查commentatorIp参数", groups = {edit.class})
    private String commentatorIp;

    /**
     * 回复父ID
     */
    @NotBlank(message = "回复父ID不能为空，请检查parentId参数", groups = {edit.class})
    private String parentId;

    /**
     * 是否审核通过 0-未审核 1-审核通过
     */
    @NotNull(message = "是否审核通过 0-未审核 1-审核通过不能为空，请检查commentStatus参数", groups = {edit.class,toggle.class})
    private Integer commentStatus;

    /**
     * 是否删除 0-未删除 1-已删除
     */
    @NotNull(message = "是否删除 0-未删除 1-已删除不能为空，请检查isDeleted参数", groups = {edit.class})
    private Integer isDeleted;

    @NotNull(message = "验证码不能为空，请检查code参数", groups = {verify.class})
    private String code;

}
